/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author msc
 */
@Entity
@Table(name = "Claim")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Claim.findAll", query = "SELECT c FROM Claim c"),
    @NamedQuery(name = "Claim.findByClaimId", query = "SELECT c FROM Claim c WHERE c.claimId = :claimId"),
    @NamedQuery(name = "Claim.findByDateOfClaim", query = "SELECT c FROM Claim c WHERE c.dateOfClaim = :dateOfClaim"),
    @NamedQuery(name = "Claim.findByHeader", query = "SELECT c FROM Claim c WHERE c.header = :header"),
    @NamedQuery(name = "Claim.findByDateOfExpense", query = "SELECT c FROM Claim c WHERE c.dateOfExpense = :dateOfExpense"),
    @NamedQuery(name = "Claim.findByServiceProvider", query = "SELECT c FROM Claim c WHERE c.serviceProvider = :serviceProvider"),
    @NamedQuery(name = "Claim.findByProviderAddress", query = "SELECT c FROM Claim c WHERE c.providerAddress = :providerAddress"),
    @NamedQuery(name = "Claim.findByPhoneNumber", query = "SELECT c FROM Claim c WHERE c.phoneNumber = :phoneNumber"),
    @NamedQuery(name = "Claim.findByEmail", query = "SELECT c FROM Claim c WHERE c.email = :email"),
    @NamedQuery(name = "Claim.findByMedicine", query = "SELECT c FROM Claim c WHERE c.medicine = :medicine"),
    @NamedQuery(name = "Claim.findByMedicineCost", query = "SELECT c FROM Claim c WHERE c.medicineCost = :medicineCost"),
    @NamedQuery(name = "Claim.findByLaboratoryTest", query = "SELECT c FROM Claim c WHERE c.laboratoryTest = :laboratoryTest"),
    @NamedQuery(name = "Claim.findByLaboratoryTestCost", query = "SELECT c FROM Claim c WHERE c.laboratoryTestCost = :laboratoryTestCost"),
    @NamedQuery(name = "Claim.findBySurgery", query = "SELECT c FROM Claim c WHERE c.surgery = :surgery"),
    @NamedQuery(name = "Claim.findBySurgeryCost", query = "SELECT c FROM Claim c WHERE c.surgeryCost = :surgeryCost"),
    @NamedQuery(name = "Claim.findByOtherItems", query = "SELECT c FROM Claim c WHERE c.otherItems = :otherItems"),
    @NamedQuery(name = "Claim.findByOtherItemsCost", query = "SELECT c FROM Claim c WHERE c.otherItemsCost = :otherItemsCost"),
    @NamedQuery(name = "Claim.findByNote", query = "SELECT c FROM Claim c WHERE c.note = :note")})
public class Claim implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ClaimId")
    private Integer claimId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DateOfClaim")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateOfClaim;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 225)
    @Column(name = "Header")
    private String header;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DateOfExpense")
    @Temporal(TemporalType.DATE)
    private Date dateOfExpense;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "ServiceProvider")
    private String serviceProvider;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "ProviderAddress")
    private String providerAddress;
    @Size(max = 15)
    @Column(name = "PhoneNumber")
    private String phoneNumber;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 255)
    @Column(name = "Email")
    private String email;
    @Size(max = 1024)
    @Column(name = "Medicine")
    private String medicine;
    @Column(name = "MedicineCost")
    private Long medicineCost;
    @Size(max = 1024)
    @Column(name = "LaboratoryTest")
    private String laboratoryTest;
    @Column(name = "LaboratoryTestCost")
    private Long laboratoryTestCost;
    @Size(max = 1024)
    @Column(name = "Surgery")
    private String surgery;
    @Column(name = "SurgeryCost")
    private Long surgeryCost;
    @Size(max = 1024)
    @Column(name = "OtherItems")
    private String otherItems;
    @Column(name = "OtherItemsCost")
    private Long otherItemsCost;
    @Size(max = 2048)
    @Column(name = "Note")
    private String note;
    @JoinColumn(name = "EmployeeId", referencedColumnName = "EmployeeId")
    @ManyToOne
    private Employee employeeId;
    @JoinColumn(name = "StatusId", referencedColumnName = "StatusId")
    @ManyToOne
    private ClaimStatus statusId;

    public Claim() {
    }

    public Claim(Integer claimId) {
        this.claimId = claimId;
    }

    public Claim(Integer claimId, Date dateOfClaim, String header, Date dateOfExpense, String serviceProvider, String providerAddress) {
        this.claimId = claimId;
        this.dateOfClaim = dateOfClaim;
        this.header = header;
        this.dateOfExpense = dateOfExpense;
        this.serviceProvider = serviceProvider;
        this.providerAddress = providerAddress;
    }

    public Integer getClaimId() {
        return claimId;
    }

    public void setClaimId(Integer claimId) {
        this.claimId = claimId;
    }

    public Date getDateOfClaim() {
        return dateOfClaim;
    }

    public void setDateOfClaim(Date dateOfClaim) {
        this.dateOfClaim = dateOfClaim;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public Date getDateOfExpense() {
        return dateOfExpense;
    }

    public void setDateOfExpense(Date dateOfExpense) {
        this.dateOfExpense = dateOfExpense;
    }

    public String getServiceProvider() {
        return serviceProvider;
    }

    public void setServiceProvider(String serviceProvider) {
        this.serviceProvider = serviceProvider;
    }

    public String getProviderAddress() {
        return providerAddress;
    }

    public void setProviderAddress(String providerAddress) {
        this.providerAddress = providerAddress;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMedicine() {
        return medicine;
    }

    public void setMedicine(String medicine) {
        this.medicine = medicine;
    }

    public Long getMedicineCost() {
        return medicineCost;
    }

    public void setMedicineCost(Long medicineCost) {
        this.medicineCost = medicineCost;
    }

    public String getLaboratoryTest() {
        return laboratoryTest;
    }

    public void setLaboratoryTest(String laboratoryTest) {
        this.laboratoryTest = laboratoryTest;
    }

    public Long getLaboratoryTestCost() {
        return laboratoryTestCost;
    }

    public void setLaboratoryTestCost(Long laboratoryTestCost) {
        this.laboratoryTestCost = laboratoryTestCost;
    }

    public String getSurgery() {
        return surgery;
    }

    public void setSurgery(String surgery) {
        this.surgery = surgery;
    }

    public Long getSurgeryCost() {
        return surgeryCost;
    }

    public void setSurgeryCost(Long surgeryCost) {
        this.surgeryCost = surgeryCost;
    }

    public String getOtherItems() {
        return otherItems;
    }

    public void setOtherItems(String otherItems) {
        this.otherItems = otherItems;
    }

    public Long getOtherItemsCost() {
        return otherItemsCost;
    }

    public void setOtherItemsCost(Long otherItemsCost) {
        this.otherItemsCost = otherItemsCost;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Employee getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(Employee employeeId) {
        this.employeeId = employeeId;
    }

    public ClaimStatus getStatusId() {
        return statusId;
    }

    public void setStatusId(ClaimStatus statusId) {
        this.statusId = statusId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (claimId != null ? claimId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Claim)) {
            return false;
        }
        Claim other = (Claim) object;
        if ((this.claimId == null && other.claimId != null) || (this.claimId != null && !this.claimId.equals(other.claimId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entities.Claim[ claimId=" + claimId + " ]";
    }
    
}
